package com.taobao.client;

import java.util.List;
import java.util.Map;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.taobao.client.obj.TopItem;
import com.taobao.client.obj.TopRefund;
import com.taobao.client.obj.TopTadget;
import com.taobao.client.obj.TopTrade;

/**
 * The client side stub for the RPC service.
 * 
 * @author
 */
@RemoteServiceRelativePath("main")
public interface UpperService extends RemoteService {	

	boolean init(String url, String app, String secrt, String loginAddress)throws Exception;

	List<TopItem> itemsGet(String nick) throws Exception;
	
	void addTrade(List<TopItem> item,String buyer, String seller,String name, String phone, String mobile, String province,
			String city, String area, String division_code, String post_code,
			String address_detail,boolean isNewAddress,String memo,String discount)throws Exception;
	
	List<TopTrade> tradeSoldGet(String nick)throws Exception;
		
	List<TopTrade> tradeBoughtGet(String nick) throws Exception;

	String setSession(String session,String name);
	
	String getSession(String userName, String password) throws Exception;
	
	String getUrl(Map<String,String> params) throws Exception;
	
	String deliverySend(String tid) throws Exception;
	
	/**
	 * Get a list of refunds as a buyer
	 * 
	 */
	List<TopRefund> getBuyerRefunds(String nick) throws Exception;

	/**
	 * Get a list of refunds as a seller
	 * 
	 * @param seller
	 * @return
	 */
	List<TopRefund> getSellerRefund(String seller) throws Exception;
	
	String logout(String domain,String url);

	String getLoginURL(String domain, String url) throws Exception;
	
	/**
	 * Get the concrete information of the refund
	 */
	TopRefund getRefundInfo(String refundId) throws Exception;

	
	/**
	 * Apply a sub appkey.
	 */
	TopTadget applySubAppKey(String parentKey, String filePath)throws Exception;

	
	/**
	 * 创建订单memo
	 * @param memo
	 * @param tid
	 * @throws Exception
	 */
	public void addTradeMemo(String memo, String tid) throws Exception;
	
	/**
	 * Get the full info of a trade
	 */
	public TopTrade getTdFullInfo(String tid, String oid) throws Exception;

}
